<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script type="text/javascript">

    function SuperType () {
        this.property = true
    }
    SuperType.prototype.getSuperValue = function () {
        return this.property
    }
    function SubType () {
        this.subproperty = false
    }
    SubType.prototype = new SuperType()
    SubType.prototype.getSubValue = function () {
        return this.subproperty
    }
    // 使用对象字面量添加新方法，会重写原型链
    SubType.prototype = {
        getSuperValue: function () {
            return this.property
        },
        someOtherMethods: function () {
            return false
        }
    }
    var instace = new SubType()
    instace.getSubValue()   // 报错，重写后没有这个方法

</script>

</body>
</html>
